<template>
  <div class="devmo">
    <!-- <a href="" @click="handleClick">跳转</a> -->
    <a href="" @click.prevent="handleClick">跳转</a>

    <hr />

    <tree-menus :list="list"></tree-menus>
  </div>
</template>
<script>
// import TreeMenus from './Tree.vue'
import { list } from './tree.js'
export default {
  // components: { TreeMenus },
  data() {
    return {
      list,
    }
  },
  created() {
    this.recursionData(this.list)
    this.list.forEach((item) => {
      item.show = true
    })
  },
  methods: {
    recursionData(list) {
      list.forEach((item) => {
        this.$set(item, 'show', false)
        if (item.children) {
          this.recursionData(item.children)
        }
      })
    },
    handleClick($event) {
      console.log($event)
      // 处理默认行为
      // $event.preventDefault()
    },
    handleBoxClick($event) {
      console.log($event.target, 'event')
    },
  },
}
</script>
